package com.apestech.framework.dictionary;

import com.apestech.framework.db.SqlSession;
import com.apestech.framework.dictionary.lib.WriteDictionary;
import com.apestech.framework.dictionary.modul.Table;
import com.apestech.framework.json.JSONArray;

public class DataDictionary extends DictUtil{

	public static void iniDictionary(SqlSession session) throws Exception {
		WriteDictionary writer=new WriteDictionary(session, getDictDir(session));
		writer.getTable();
		writer.getProcedure();
	}

	public static Table getTable(SqlSession session, String tabName) throws Exception{
		return DataTable.getTable(session, tabName);
	}

	public static Table getTableFromDB(SqlSession session, String tabName) throws Exception{
		return DataTable.getTableFromDB(session, tabName);
	}

	public static Table refreshTable(SqlSession session, String tabName) throws Exception {
		return DataTable.refreshTable(session, tabName);
	}

	public static void updateTableCache(String tabName, Table map){
		DataTable.updateTableCache(tabName, map);
	}

	public static JSONArray getProcedure(SqlSession session, String procName) throws Exception{
		return DataProcedure.getProcedure(session, procName);
	}

	public static JSONArray refreshProcedure(String procName, SqlSession session) throws Exception {
		return DataProcedure.refreshProcedure(procName, session);
	}
}
